package bishi.saijing;

import java.util.HashSet;
import java.util.Scanner;

/**
 * @author: Tangxz
 * @email: 1171702529@qq.com
 * @cate: 2022/03/27 09:17
 */
public class _02 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        HashSet<Integer> set = new HashSet<>();
        int n = sc.nextInt();
        int[] nums = new int[n];
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        for (int i = 0; i < n; i++) {
            nums[i] = sc.nextInt();
            set.add(nums[i]);
            max = Math.max(max, nums[i]);
            min = Math.min(min, nums[i]);
        }
        int res = (max + min) / 2;
        for (int p = 0; p < 100; p++) {
            for (int q = 0, w = p; q < 2 && p > 0; q++, w = -p) {
                int nowRes = res + w;
                if (!set.contains(nowRes)) {
                    boolean isUp = true;
                    int last = 0;
                    for (int a : nums) {
                        int low = a - nowRes;
                        int up = a + nowRes;
                        if (last >= up) {
                            isUp = false;
                            break;
                        }
                        if (last < low&&low>0) last = low;
                        else last++;
                    }
                    if (isUp) {
                        System.out.println(nowRes);
                        return;
                    }
                }
            }
        }
    }
}
